#!/usr/bin/env dash
#------------------
GITEE_lINUX="${HOME}/data/git/ee/linux"
GITHUB_LINUX="${HOME}/data/git/hub/tmoe-linux"
OLD_VERSION_DIR="${GITEE_lINUX}/share/old-version"

# COUNT=$(curl -L https://gitee.com/mo2/linux | awk '/commit/' | grep '\ commits' | head -n 1 | awk '{print $1}')
# COUNT=$(curl -L https://gitee.com/mo2/linux | grep '次提交' | head -n 1 | awk '{print $1}')
# case ${COUNT} in
# "") ;;
# [0-9]*[0-9])
#     COMMIT_COUNT=$((COUNT + 1))
#     sed -i -E "s@(tmoe linux manager) v1.*?,@\1 v1.${COMMIT_COUNT},@g" ${OLD_VERSION_DIR}/share/app/manager
#     sed -i -E "s@(tmoe linux tools) v1.*?,@\1 v1.${COMMIT_COUNT},@g" ${OLD_VERSION_DIR}/tools/app/tool
#     ;;
# esac
##########
cd "${GITEE_lINUX}" || exit 1
for i in $(/bin/ls -A ./ | grep -Ev "test|README.md|.git$|.gitee"); do
    cp -va "${i}" "${GITHUB_LINUX}"
done

cd "${GITHUB_LINUX}"/share/sed/ || exit 1
./sed_github
###########
# code ~/github/github-linux
